import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long x = in.nextInt();
        for(int i = 0; i < n; i++) {
            long a = in.nextInt();
            if(a <= x) {
                x += a;
            } else {
                x += gcd(x, a);
            }
        }
        System.out.println(x);
    }

    public static long gcd(long a, long b) {
        while(b != 0) {
            long tmp = a % b;
            a = b;
            b = tmp;
        }
        return a;
    }
}